-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server: add Uptime status counter #8888
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8888 +/- ##
==========================================
+ Coverage 67.25% 67.25% +<.01%
==========================================
Files 372 372
Lines 76301 76203 -98
==========================================
- Hits 51316 51253 -63
+ Misses 20453 20418 -35
Partials 4532 4532
Continue to review full report at Codecov.
|
@morgo How about testing like this:
Since you are calculating duration, so you can change the lower bound instead of the upper bound. For case 1, it will not slow down the tests. If you want to assert upper limit, or want exact equal assertion, maybe you need to implement a mock time producer that offers |
@@ -0,0 +1,37 @@ | |||
// Copyright 2018 PingCAP, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Copyright 2018 PingCAP, Inc. | |
// Copyright 2019 PingCAP, Inc. |
@morgo friendly ping, any update? |
Hi contributor, thanks for your PR. This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically. |
@jackysp Since we have monitored the |
This PR still has some compatibility improvements. But not so important. Maybe we can close it first? @zz-jason |
I'm going to close this PR due to outdated, fell free to reopen it if you are going to process it again in the future. |
What problem does this PR solve?
Fixes #8842
What is changed and how it works?
Uses variable infrastructure to push
Uptime
statistic. So you can now do this, as in MySQL:Check List
Tests
I would like to add a test, but I wanted to check first - since the logical way to do it is to run
show global status
, sleep a second, and then run it again. But I don't know if:As an alternative, I could assert that the value is greater than zero? Feedback welcome.
Code changes
Side effects
Related changes
This change is